package beans;

import net.sourceforge.floggy.persistence.FloggyException;
import net.sourceforge.floggy.persistence.Persistable;
import net.sourceforge.floggy.persistence.PersistableManager;

public class Usuario implements Persistable {

    private int id;
    private String nome;
    private String login;
    private String senha;

    public int getId() {
        return this.id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getNome() {
        return this.nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getLogin() {
        return this.login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getSenha() {
        return this.senha;
    }

    public void setSenha(String senha) {
        this.senha = senha;
    }

    public void save() {
        try {
            setId(PersistableManager.getInstance().save(this));
            PersistableManager.getInstance().save(this);
        } catch (FloggyException ex) {
            ex.printStackTrace();
        }
    }
}

